package com.ruoyi.production.service.impl.seed;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.seed.SeedApplyTemporary;
import com.ruoyi.production.mapper.seed.SeedApplyTemporaryMapper;
import com.ruoyi.production.service.seed.ISeedApplyTemporaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 种子临时申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-07
 */
@Service
public class SeedApplyTemporaryServiceImpl implements ISeedApplyTemporaryService
{
    @Autowired
    private SeedApplyTemporaryMapper seedApplyTemporaryMapper;

    /**
     * 查询种子临时申请
     *
     * @param seedApplyTemporaryId 种子临时申请ID
     * @return 种子临时申请
     */
    @Override
    public SeedApplyTemporary selectSeedApplyTemporaryById(Long seedApplyTemporaryId)
    {
        return seedApplyTemporaryMapper.selectSeedApplyTemporaryById(seedApplyTemporaryId);
    }

    /**
     * 查询种子临时申请列表
     *
     * @param seedApplyTemporary 种子临时申请
     * @return 种子临时申请
     */
    @Override
    public List<SeedApplyTemporary> selectSeedApplyTemporaryList(SeedApplyTemporary seedApplyTemporary)
    {
        return seedApplyTemporaryMapper.selectSeedApplyTemporaryList(seedApplyTemporary);
    }

    /**
     * 新增种子临时申请
     *
     * @param seedApplyTemporary 种子临时申请
     * @return 结果
     */
    @Override
    public int insertSeedApplyTemporary(SeedApplyTemporary seedApplyTemporary)
    {
        seedApplyTemporary.setCreateTime(DateUtils.getNowDate());
        return seedApplyTemporaryMapper.insertSeedApplyTemporary(seedApplyTemporary);
    }

    /**
     * 修改种子临时申请
     *
     * @param seedApplyTemporary 种子临时申请
     * @return 结果
     */
    @Override
    public int updateSeedApplyTemporary(SeedApplyTemporary seedApplyTemporary)
    {
        seedApplyTemporary.setUpdateTime(DateUtils.getNowDate());
        return seedApplyTemporaryMapper.updateSeedApplyTemporary(seedApplyTemporary);
    }

    /**
     * 批量删除种子临时申请
     *
     * @param seedApplyTemporaryIds 需要删除的种子临时申请ID
     * @return 结果
     */
    @Override
    public int deleteSeedApplyTemporaryByIds(Long[] seedApplyTemporaryIds)
    {
        return seedApplyTemporaryMapper.deleteSeedApplyTemporaryByIds(seedApplyTemporaryIds);
    }

    /**
     * 删除种子临时申请信息
     *
     * @param seedApplyTemporaryId 种子临时申请ID
     * @return 结果
     */
    @Override
    public int deleteSeedApplyTemporaryById(Long seedApplyTemporaryId)
    {
        return seedApplyTemporaryMapper.deleteSeedApplyTemporaryById(seedApplyTemporaryId);
    }
}
